package com.ssm.instantite;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class InstanceTest3 {
    public static void main(String[] args) {
        String xmlPath = "Spring-bean1.xml";
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext(xmlPath);
        Bean3 bean3 = (Bean3) applicationContext.getBean("bean3");
        System.out.println(bean3);
        /*因为运用实例化工厂，在工厂中可以定义构造函数，构造函数在实例化的时候执行，相比于 静态工厂和构造器，这样能多实现功能*/
    }
}
